Systems for generating X rays by irradiating a liquid target are described in the applicant's International Applications PCT/EP2009/000481, PCT/EP2009/002464, PCT/EP2010/068843 and PCT/SE2011/051557. In these systems, which typically operate at very low pressures, an electron gun comprising a high-voltage cathode is utilized to produce an electron beam which impinges on the target. Free particles, including debris and vapour from the liquid target, tend to gradually degrade the cathode (e.g., by corrosion) and reduce its useful life. Similar problems associated with chemical cathode degradation have been noted in high-energy electron irradiation systems with cathodes operating at a high potential and/or high temperature.